<template>
	<view style="margin-top: 30rpx;">
		<view class="content">
			<view v-if="list.length>0">
				<view class="list" v-for="(item,index) in list" :key="index">
					<view class="detail">
						<view class="view">
							<view class="name">
								兑换数量
							</view>
							<view class="text font" style="color: #F46813;">
								{{item.apply_number}} <text> 张</text>
							</view>
						</view>
						<view class="view">
							<view class="name">
								兑换消耗
							</view>
							<view class="text">
								{{item.buy_number}} {{ item.buy_type==1?'Fmb':'Ghy'}}
							</view>
						</view>
						<view class="view">
							<view class="name">
								兑换时间
							</view>
							<view class="text">
								{{item.ctime}}
							</view>
						</view>
						<image src="../static/j1.png" v-if="item.status==1" class="icon"></image>
						<image src="../static/j2.png" v-if="item.status==2" class="icon"></image>
						<image src="../static/j3.png" v-if="item.status==0" class="icon"></image>
					</view>
				</view>
			</view>
			<view class="none" v-else>
				<view class="none-view">
					<image src="../../../static/image/none.png" class="none-image"></image>
					<view class="none-name">
						暂无相关数据~
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var than;
	export default {
		data() {
			return {
				type: 1,
				list: [],
				page: 1
			}
		},
		onLoad(option) {
			than = this;
			than.getList()
		},
		onReachBottom() {
			than.page++;
			than.getList()
		},
		methods: {
			getList() {
				than.post("api/Goldbean/applyExchangeGdbTicketList", {
					page: than.page
				}, function(data) {
					if (than.page == 1) {
						than.list = data;
					} else {
						than.list = than.list.concat(data)
					}
				})
			}
		}
	}
</script>

<style lang="less">
	.record {
		position: fixed;
		width: 135rpx;
		height: 135rpx;
		bottom: 70rpx;
		left: 40rpx;
	}

	.tabs {
		display: flex;
		align-items: center;
		padding: 20rpx 39rpx;

		.list {
			width: 145rpx;
			height: 59rpx;
			background: #FFFFFF;
			border-radius: 30rpx;
			line-height: 59rpx;
			text-align: center;
			color: #000000;
			margin-right: 20rpx;
		}

		.active {
			color: #FFFFFF;
			background: linear-gradient(180deg, #FFC044, #FECA75);
			box-shadow: 0px 4rpx 6rpx 0px rgba(254, 200, 108, 0.2);
		}

	}

	.top {
		padding: 20rpx 0;
	}

	page {
		background: #F4F4F7;
	}

	.content {
		padding: 0 36rpx;

		.list {
			height: 180rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			padding: 0 24rpx;
			display: flex;
			align-items: center;
			margin-bottom: 24rpx;
			position: relative;

			image {
				width: 89rpx;
				height: 89rpx;
			}

			.icon {
				position: absolute;
				top: 0;
				right: 125rpx;
				width: 124rpx;
				height: 105rpx;
			}

			.detail {
				margin-left: 20rpx;

				.view {
					display: flex;
					align-items: center;
					height: 50rpx;

					.name {
						font-size: 30rpx;
						color: #666666;
						font-weight: bold;
					}

					.text {
						margin-left: 23rpx;
						font-size: 28rpx;
						font-weight: bold;
						font-style: initial;

						text {
							font-size: 26rpx;
							margin-left: 10rpx;
						}
					}
				}


				.add {
					color: #F46813;
				}

				.sub {
					color: #1B1B1D;
				}


			}

			.right {
				display: flex;
				align-items: center;
				margin-left: auto;

				.button {
					margin-left: 35rpx;
					text-align: center;

					image {
						width: 50rpx;
						height: 50rpx;
					}

					.name {
						font-size: 22rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #666666;
					}
				}
			}
		}
	}
</style>
